class CreateProfiles < ActiveRecord::Migration
  def self.up
    create_table :profiles do |t|
      t.string :nameth
      t.string :lastnameth
      t.string :nameeng
      t.string :nickname
      t.string :generation
      t.date :birthday
      t.string :nationality
      t.string :religious
      t.string :socialstatus
      t.string :studystatus
      t.string :address
      t.string :telphone
      t.string :celphone
      t.string :email
      t.string :blogaddress

			#for has_iamge plugin
			t.string :has_image_file

      t.timestamps
    end

		#
		# create init admin profile
		#
		pro = Profile.create \
			:nameeng => 'admin',
			:nameth => 'admin',
			:lastnameth => 'admin',
			:nationality => 'admin',
			:studystatus => 'admin',
			:birthday => Date.today
		pro.user = User.first
		pro.save
  end

  def self.down
    drop_table :profiles
  end
end
